package com.hengpeng.msls.port;

import java.util.List;

import com.hengpeng.common.persist.QueryParameter;
import com.hengpeng.common.persist.QueryResult;
import com.hengpeng.common.persist.entity.AbstractEntity;
import com.hengpeng.common.persist.query.DynamicQuery;
import com.hengpeng.itfinbase.message.ResponseMessage;
import com.hengpeng.itfinbase.message.TransMessage;

public interface PortFactory
{
	public <T> T doPostTrans(String transName, Class<T> returnType, Object parameter, Object... pathValue);
	
	public <T extends AbstractEntity> Long count(Class<T> type, DynamicQuery query);
	
	public <T extends AbstractEntity> List<Object> findObject(Class<T> type, DynamicQuery query);
	
	public <T extends AbstractEntity> T getEntity(DynamicQuery query, Class<T> clz);
	
	public <T extends AbstractEntity> T getEntityById(Object id, Class<T> clz);
	
	public Integer getSingleInteger(DynamicQuery query);
	
	public List<Object> queryList(DynamicQuery query);
	
	public <T extends AbstractEntity> List<T> queryList(DynamicQuery query, Class<T> clz);
	
	public <T extends AbstractEntity> QueryResult<T> remoteQuery(DynamicQuery query, Class<T> clz);
	
	public <T extends AbstractEntity> QueryResult<T> remoteQuery(QueryParameter<T> queryParameters);
	
	public ResponseMessage remoteTrans(TransMessage transMessage);
	
	public <T extends ResponseMessage> T remoteTrans(TransMessage transMessage, Class<T> clz);
}
